﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Yxinmt.Windows.Meeting
{
    public class InkCanvasProperty
    {
        public Action<double> StrokeWidth { get; set; }

        public Action<bool> IsFill { get; set; }

        public Action<string, float, bool, bool> TextFont { get; set; }

        public Action<string> Color { get; set; }

        public Func<string> GetColor { get; set; }

        public Action<Controls.InkCanvasShapeType> ShapeType { get; set; }

        public Action SetCursor { get; set; }

        public Action Cancel { get; set; }

        public Action BackCancel { get; set; }

        public Action Clear { get; set; }

        public Func<bool> IsDrawSave { get; set; }

        public Func<byte[]> SaveInkElements { get; set; }

        public Action<byte[]> SetInkElements { get; set; }

        public InkCanvasProperty(Controls.InkCanvas inkCanvas)
        {
            StrokeWidth = (w) => inkCanvas.SetStrokeWidth(w);

            IsFill = (f) => inkCanvas.SetFill(f);

            TextFont = (f, s, b, i) => inkCanvas.SetTextFont(f, s, b, i);

            Color = (c) => inkCanvas.SetColor(c);

            GetColor = () => inkCanvas.GetColor();

            ShapeType = (t) => inkCanvas.ShapeType = t;

            SetCursor = () => inkCanvas.SetCursor();

            Cancel = () => inkCanvas.Cancel();

            BackCancel = () => inkCanvas.BackCancel();

            Clear = () => inkCanvas.Clear();

            IsDrawSave = () => inkCanvas.IsDraw && !inkCanvas.IsSave;

            SaveInkElements = () => inkCanvas.SaveInkElements();

            SetInkElements = (bs) => inkCanvas.SetInkElements(bs);
        }
    }
}
